Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add send_vectored for unix socket #69915

Closed
wants to merge 1 commit into from

Conversation

contrun
Copy link
Contributor

@contrun contrun commented Mar 11, 2020

closes #68612

Currently only supports send as I didn't find binding for sendmsg. connect and send costs two syscalls.

@rust-highfive
Copy link
Collaborator

r? @withoutboats

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 11, 2020
/// Ok(())
/// }
/// ```
#[stable(feature = "unix_socket", since = "1.10.0")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the correct way to specify this attribute? I didn't find the relevant documentation.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-11T10:47:22.6579801Z ========================== Starting Command Output ===========================
2020-03-11T10:47:22.6584481Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/3b423acd-605f-4e7c-ad94-869a2f0f3e60.sh
2020-03-11T10:47:22.6584783Z 
2020-03-11T10:47:22.6589821Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-11T10:47:22.6611557Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T10:47:22.6615118Z Task         : Get sources
2020-03-11T10:47:22.6615451Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-11T10:47:22.6615792Z Version      : 1.0.0
2020-03-11T10:47:22.6616011Z Author       : Microsoft
---
2020-03-11T10:47:23.6632743Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-11T10:47:23.6641850Z ##[command]git config gc.auto 0
2020-03-11T10:47:23.6650056Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-11T10:47:23.6660817Z ##[command]git config --get-all http.proxy
2020-03-11T10:47:23.6669193Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69915/merge:refs/remotes/pull/69915/merge
---
2020-03-11T10:53:11.9187617Z Found 0 error codes with no tests
2020-03-11T10:53:11.9187823Z Done!
2020-03-11T10:53:11.9210646Z 
2020-03-11T10:53:11.9218123Z 
2020-03-11T10:53:11.9219632Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2020-03-11T10:53:11.9220524Z 
2020-03-11T10:53:11.9220636Z 
2020-03-11T10:53:11.9220935Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-03-11T10:53:11.9221386Z Build completed unsuccessfully in 0:01:32
2020-03-11T10:53:11.9221386Z Build completed unsuccessfully in 0:01:32
2020-03-11T10:53:11.9268107Z == clock drift check ==
2020-03-11T10:53:11.9281402Z   local time: Wed Mar 11 10:53:11 UTC 2020
2020-03-11T10:53:12.0236385Z   network time: Wed, 11 Mar 2020 10:53:12 GMT
2020-03-11T10:53:12.0237042Z == end clock drift check ==
2020-03-11T10:53:12.7817815Z 
2020-03-11T10:53:12.7897267Z ##[error]Bash exited with code '1'.
2020-03-11T10:53:12.7919122Z ##[section]Finishing: Run build
2020-03-11T10:53:12.7982056Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T10:53:12.8011814Z Task         : Get sources
2020-03-11T10:53:12.8012310Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-11T10:53:12.8012765Z Version      : 1.0.0
2020-03-11T10:53:12.8013083Z Author       : Microsoft
2020-03-11T10:53:12.8013083Z Author       : Microsoft
2020-03-11T10:53:12.8013576Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-11T10:53:12.8014368Z ==============================================================================
2020-03-11T10:53:13.1850822Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-11T10:53:13.1915197Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T10:53:13.2009468Z Cleaning up task key
2020-03-11T10:53:13.2011146Z Start cleaning up orphan processes.
2020-03-11T10:53:13.2223900Z Terminate orphan process: pid (3632) (python)
2020-03-11T10:53:13.2451415Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@LinkTed
Copy link
Contributor

LinkTed commented Mar 11, 2020

I wrote a similar functions in PR #69864.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-11T16:12:11.8491702Z ========================== Starting Command Output ===========================
2020-03-11T16:12:11.8494080Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/7b07fdb6-f54c-4527-ba55-dd8c466c049d.sh
2020-03-11T16:12:11.8494305Z 
2020-03-11T16:12:11.8497466Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-11T16:12:11.8517789Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T16:12:11.8521238Z Task         : Get sources
2020-03-11T16:12:11.8521488Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-11T16:12:11.8521746Z Version      : 1.0.0
2020-03-11T16:12:11.8521907Z Author       : Microsoft
---
2020-03-11T16:12:12.8524110Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-11T16:12:12.8529336Z ##[command]git config gc.auto 0
2020-03-11T16:12:12.8533303Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-11T16:12:12.8537481Z ##[command]git config --get-all http.proxy
2020-03-11T16:12:12.8543978Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69915/merge:refs/remotes/pull/69915/merge
---
2020-03-11T17:10:22.9459255Z .................................................................................................... 1700/9761
2020-03-11T17:10:27.1572251Z .................................................................................................... 1800/9761
2020-03-11T17:10:37.7417381Z ................................................................i................................... 1900/9761
2020-03-11T17:10:44.1995219Z .................................................................................................... 2000/9761
2020-03-11T17:10:57.8036799Z ......................................................iiiii......................................... 2100/9761
2020-03-11T17:11:07.3860689Z .................................................................................................... 2300/9761
2020-03-11T17:11:09.3795657Z .................................................................................................... 2400/9761
2020-03-11T17:11:12.3524286Z .................................................................................................... 2500/9761
2020-03-11T17:11:32.6999050Z .................................................................................................... 2600/9761
---
2020-03-11T17:14:03.4411830Z .........................i...............i.......................................................... 5000/9761
2020-03-11T17:14:13.4816773Z .................................................................................................... 5100/9761
2020-03-11T17:14:19.0889472Z ....................................................................i............................... 5200/9761
2020-03-11T17:14:25.1885948Z .................................................................................................... 5300/9761
2020-03-11T17:14:34.3344119Z .................................................ii.ii........i...i................................. 5400/9761
2020-03-11T17:14:42.3282022Z .................................................................................................... 5600/9761
2020-03-11T17:14:51.5244700Z .................................................................................................... 5700/9761
2020-03-11T17:14:57.6187243Z ........................................i........................................................... 5800/9761
2020-03-11T17:15:03.6787751Z .................................................................................................... 5900/9761
2020-03-11T17:15:03.6787751Z .................................................................................................... 5900/9761
2020-03-11T17:15:13.5667312Z .................................................................................................... 6000/9761
2020-03-11T17:15:21.8375145Z .................................ii...i..ii...........i............................................. 6100/9761
2020-03-11T17:15:37.7352397Z .................................................................................................... 6300/9761
2020-03-11T17:15:44.0073659Z .................................................................................................... 6400/9761
2020-03-11T17:15:44.0073659Z .................................................................................................... 6400/9761
2020-03-11T17:15:54.1063355Z ................................................................i..ii............................... 6500/9761
2020-03-11T17:16:24.3855203Z .................................................................................................... 6700/9761
2020-03-11T17:16:29.3365619Z ............................................................i....................................... 6800/9761
2020-03-11T17:16:31.2026120Z .................................................................................................... 6900/9761
2020-03-11T17:16:33.0726259Z ...........................................................................................i........ 7000/9761
---
2020-03-11T17:18:06.2708596Z .................................................................................................... 7700/9761
2020-03-11T17:18:10.2630715Z .................................................................................................... 7800/9761
2020-03-11T17:18:16.0649041Z .................................................................................................... 7900/9761
2020-03-11T17:18:22.2313244Z .........................................i.......................................................... 8000/9761
2020-03-11T17:18:31.5100793Z ..........................................................................................iiiiiiiiii 8100/9761
2020-03-11T17:18:37.7343182Z .i.................................................................................................. 8200/9761
2020-03-11T17:18:51.2527661Z .................................................................................................... 8400/9761
2020-03-11T17:19:01.8572602Z .................................................................................................... 8500/9761
2020-03-11T17:19:13.4699974Z .................................................................................................... 8600/9761
2020-03-11T17:19:18.3126363Z .................................................................................................... 8700/9761
---
2020-03-11T17:21:25.5452005Z  finished in 6.718
2020-03-11T17:21:25.5643887Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:21:26.5379315Z 
2020-03-11T17:21:26.5474205Z running 179 tests
2020-03-11T17:21:28.4348390Z iiii......i...........ii..iiii....i....i...........i............i..i..................i....i........ 100/179
2020-03-11T17:21:30.6063238Z ....i.i.i...iii..iiiiiiiiiiiiiiii.......................iii............ii......
2020-03-11T17:21:30.6065828Z 
2020-03-11T17:21:30.6066426Z  finished in 5.042
2020-03-11T17:21:30.6245991Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:21:30.7711551Z 
---
2020-03-11T17:21:33.5461527Z  finished in 1.926
2020-03-11T17:21:33.5462173Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:21:33.5462420Z 
2020-03-11T17:21:33.5462566Z running 9 tests
2020-03-11T17:21:33.5463075Z iiiiiiiii
2020-03-11T17:21:33.5463912Z 
2020-03-11T17:21:33.5464042Z  finished in 0.147
2020-03-11T17:21:33.5464535Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:21:33.5464802Z 
---
2020-03-11T17:21:50.9770914Z  finished in 18.244
2020-03-11T17:21:50.9960443Z Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:21:51.1427738Z 
2020-03-11T17:21:51.1428006Z running 115 tests
2020-03-11T17:22:03.5217924Z iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i..i.......ii.i.ii.. 100/115
2020-03-11T17:22:05.1964181Z ...iiii.....ii.
2020-03-11T17:22:05.1966564Z 
2020-03-11T17:22:05.1971136Z  finished in 14.201
2020-03-11T17:22:05.1976647Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-11T17:22:05.1977489Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2020-03-11T17:34:19.1387411Z 
2020-03-11T17:34:19.1388261Z    Doc-tests core
2020-03-11T17:34:23.4982196Z 
2020-03-11T17:34:23.4987744Z running 2480 tests
2020-03-11T17:34:31.9548683Z ......iiiii......................................................................................... 100/2480
2020-03-11T17:34:40.2412216Z ....................................................................................ii.............. 200/2480
2020-03-11T17:34:59.4287400Z ...................i................................................................................ 400/2480
2020-03-11T17:34:59.4287400Z ...................i................................................................................ 400/2480
2020-03-11T17:35:08.4958073Z ........................................................................i..i..................iiii.. 500/2480
2020-03-11T17:35:23.5627675Z .................................................................................................... 700/2480
2020-03-11T17:35:31.3484620Z .................................................................................................... 800/2480
2020-03-11T17:35:39.0888375Z .................................................................................................... 900/2480
2020-03-11T17:35:46.8582568Z .................................................................................................... 1000/2480
---
2020-03-11T17:39:10.4106675Z 
2020-03-11T17:39:10.4108037Z running 1011 tests
2020-03-11T17:39:27.4452957Z i................................................................................................... 100/1011
2020-03-11T17:39:36.8129686Z .................................................................................................... 200/1011
2020-03-11T17:39:43.3207085Z ..................iii......i......i...i......i...................................................... 300/1011
2020-03-11T17:39:48.0086907Z .................................................................................................... 400/1011
2020-03-11T17:39:54.2543687Z ............................................i..i......................................ii............ 500/1011
2020-03-11T17:40:05.6667475Z .................................................................................................... 700/1011
2020-03-11T17:40:05.6667475Z .................................................................................................... 700/1011
2020-03-11T17:40:11.8737584Z ....................................iiii............................................................ 800/1011
2020-03-11T17:40:24.8634037Z .................................................................................................... 900/1011
2020-03-11T17:40:31.1171033Z .......................F...................................iiii..................................... 1000/1011
2020-03-11T17:40:31.5347290Z failures:
2020-03-11T17:40:31.5347410Z 
2020-03-11T17:40:31.5351825Z ---- sys/unix/ext/net.rs - sys::unix::ext::net::UnixDatagram::send_vectored (line 1420) stdout ----
2020-03-11T17:40:31.5352524Z error[E0658]: use of unstable library feature 'unix_socket_send_vectored'
2020-03-11T17:40:31.5352524Z error[E0658]: use of unstable library feature 'unix_socket_send_vectored'
2020-03-11T17:40:31.5353001Z   --> sys/unix/ext/net.rs:1428:10
2020-03-11T17:40:31.5353186Z    |
2020-03-11T17:40:31.5353448Z 10 |     sock.send_vectored(&bufs).expect("send_vectored function failed");
2020-03-11T17:40:31.5354125Z    |
2020-03-11T17:40:31.5354125Z    |
2020-03-11T17:40:31.5354834Z    = note: see issue #68612 <***/issues/68612> for more information
2020-03-11T17:40:31.5355361Z    = help: add `#![feature(unix_socket_send_vectored)]` to the crate attributes to enable
2020-03-11T17:40:31.5355807Z error: aborting due to previous error
2020-03-11T17:40:31.5355970Z 
2020-03-11T17:40:31.5356503Z For more information about this error, try `rustc --explain E0658`.
2020-03-11T17:40:31.5356935Z Couldn't compile the test.
---
2020-03-11T17:40:31.5556483Z   local time: Wed Mar 11 17:40:31 UTC 2020
2020-03-11T17:40:31.8521083Z   network time: Wed, 11 Mar 2020 17:40:31 GMT
2020-03-11T17:40:31.8524102Z == end clock drift check ==
2020-03-11T17:40:32.3228792Z 
2020-03-11T17:40:32.3316341Z ##[error]Bash exited with code '1'.
2020-03-11T17:40:32.3333976Z ##[section]Finishing: Run build
2020-03-11T17:40:32.3380382Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T17:40:32.3384851Z Task         : Get sources
2020-03-11T17:40:32.3385151Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-11T17:40:32.3385444Z Version      : 1.0.0
2020-03-11T17:40:32.3385642Z Author       : Microsoft
2020-03-11T17:40:32.3385642Z Author       : Microsoft
2020-03-11T17:40:32.3385949Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-11T17:40:32.3386321Z ==============================================================================
2020-03-11T17:40:32.6475505Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-11T17:40:32.6516593Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69915/merge to s
2020-03-11T17:40:32.6598970Z Cleaning up task key
2020-03-11T17:40:32.6600167Z Start cleaning up orphan processes.
2020-03-11T17:40:32.6758306Z Terminate orphan process: pid (4183) (python)
2020-03-11T17:40:32.6979788Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@joshtriplett
Copy link
Member

@contrun As far as I can tell, the changes that @LinkTed made in #69864 do use libc::sendmsg. I think it may make sense to use a common implementation here.

@contrun
Copy link
Contributor Author

contrun commented Mar 12, 2020

@LinkTed @joshtriplett Thanks. I will close this one.

@contrun contrun closed this Mar 12, 2020
@Ralith
Copy link
Contributor

Ralith commented Apr 26, 2020

It might be nice to get this in separately from #69864, since just send_vectored doesn't require working out an API for ancillary data and can presumably be reviewed and merged much more quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnixDatagram: please support vectored send
6 participants